package com.imy.luascript.utils;

import android.view.View;

public final class ToolBarBuilder {
    private boolean showBack = true;
    private boolean hasToolbar = true;
    private View toolbar;

    private ToolBarBuilder(Builder builder) {
        this.hasToolbar = builder.hasToolbar;
        this.toolbar = builder.toolbar;
        this.showBack = builder.showBack;
    }


    public boolean getShowBack() {
        return showBack;
    }

    public boolean getHasToolbar() {
        return hasToolbar;
    }

    public View getToolbar() {
        return toolbar;
    }

    public static class Builder {

        private boolean hasToolbar;
        private View toolbar;
        private boolean showBack;

        public Builder() {
            hasToolbar = true;
            showBack = true;
            toolbar = null;
        }

        public Builder setShowBack(boolean showBack) {
            this.showBack = showBack;
            return this;
        }

        public Builder setHasToolbar(boolean hasToolbar) {
            this.hasToolbar = hasToolbar;
            return this;
        }

        public Builder setView(View toolbar) {
            this.toolbar = toolbar;
            return this;
        }

        public ToolBarBuilder build() {
            return new ToolBarBuilder(this);
        }
    }

}
